#include("../_inc/_layout.html")
#@layout("登录 - Jboot Fly",null,null,"jie")
#define content()
<div class="layui-container" style="margin-top: 20px">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8 content detail">
            <div class="fly-panel detail-box">
                <h1>#(userAttachment.attachmentTitle)</h1>
                <div class="fly-detail-info" style="padding-top: 12px">
                    <!-- <span class="layui-badge">审核中</span> -->
                    <!--<span class="layui-badge layui-bg-green fly-detail-column">提问</span>-->
                    <!--<span class="layui-badge" style="background-color: #999;">未结</span>-->
                    <div class="fly-admin-box" data-id="655cd1b5891541bf922352921a9baa43">
                    </div>
                    <span class="fly-list-nums">
                        <a href="#download" id="download" ><img  style="width: 25px;height:25px" src="/static/images/right/download.jpg" title="下载"></img></a>
                        <a href="#download"><i class="iconfont" title="评论"></i> 0</a>
                        <i class="iconfont" title="人气"></i> 5
                    </span>
                </div>
                <div class="detail-about">
                    <a class="fly-avatar" href="/user/#(post.user.id)"> <img src="#(post.user.avatar)" alt="#(post.user.nickname)" /> </a>
                    <div class="fly-detail-user">
                        <a href="https://fly.layui.com/u/6665064/" class="fly-link"> <cite>安静的落落</cite> </a>
                        <span style="margin-right:10px;">#(userAttachment.createdTime)上传 </span>
                        <span>大小:#(userAttachment.attachmentSize)KB</span>
                    </div>
                    <div class="fly-detail-user">

                        <span sty1e="margin-right:10px">文件：#(userAttachment.attachmentName)</span>
                    </div>
                </div>

                <div class="detail-body photos">
                        #(userAttachment.attachmentInstruction)
                </div>
            </div>
            <div class="fly-panel detail-box" id="flyReply">
                <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
                    <legend>评论</legend>
                </fieldset>
                <ul class="jieda" id="jieda">
                    #for(comment : pageData.list)
                    <li data-id="#(comment.id)">
                        <a name="item-#(comment.id)"></a>
                        <div class="detail-about detail-about-reply">
                            <a class="fly-avatar" href="">
                                <img src="#(comment.user.avatar)" alt=" ">
                            </a>
                            <div class="fly-detail-user">
                                <a href="" class="fly-link">
                                    <cite>#(comment.user.nickname)</cite>
                                </a>
                            </div>
                            <div class="detail-hits">
                                <span>2017-11-30</span>
                            </div>
                            #if(comment.isAdopted())
                            <i class="iconfont icon-caina" title="最佳答案"></i>
                            #end
                        </div>
                        <div class="detail-body jieda-body photos">
                            #(comment.content)
                        </div>
                        <div class="jieda-reply">
              <span class="jieda-zan" type="zan">
                <i class="iconfont icon-zan"></i>
                  <!--<em>0</em>-->
                <em>#(comment.vote_up ?? 0)</em>
              </span>

                            <!-- 鄙视暂时使用这个图标 -->
                            <span class="jieda-zan" type="zan">
                <img src="/static/images/right/gb12.png" alt="" class="imgicon">
                <em>0</em>
              </span>

                            <span type="reply">
                <i class="iconfont icon-svgmoban53"></i>
                回复
              </span>
                            <div class="jieda-admin">
                                #if(USER && (USER.isAdmin() || USER.id == post.user_id))
                                <span type="edit">编辑</span>
                                <span type="del">删除</span>
                                <span class="jieda-accept" type="accept">采纳</span>
                                #end
                            </div>
                        </div>
                    </li>
                    #end

                    <!-- 无数据时 -->
                    <!-- <li class="fly-none">消灭零回复</li> -->
                </ul>
                #if(pageData.totalPage > 1)
                #include("../_inc/_pagination.html")
                #end
                <div class="layui-form layui-form-pane">
                    <form action="/api/commentAdd" method="post">
                        <div class="layui-form-item layui-form-text">
                            <a name="comment"></a>
                            <div class="layui-input-block">
                                <textarea id="L_content" name="content" required="" lay-verify="required" placeholder="请输入内容" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <input type="hidden" name="id" value="#(post.id)">
                            <button class="layui-btn" lay-filter="*" lay-submit="">提交回复</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">
                    本周热议
                </dt>
                <dd>
                    <a href="https://fly.layui.com/jie/33664/">table 如何更优雅的 reload</a>
                    <span><i class="iconfont icon-pinglun1"></i> 38</span>
                </dd>
                <dd>
                    <a href="https://fly.layui.com/jie/33592/">layui富文本字体颜色</a>
                    <span><i class="iconfont icon-pinglun1"></i> 15</span>
                </dd>
                <dd>
                    <a href="https://fly.layui.com/jie/33647/">treeGrid树状图</a>
                    <span><i class="iconfont icon-pinglun1"></i> 15</span>
                </dd>
                <dd>
                    <a href="https://fly.layui.com/jie/33666/">layui的引用</a>
                    <span><i class="iconfont icon-pinglun1"></i> 13</span>
                </dd>
            </dl>
            <div class="fly-panel">
                <div class="fly-panel-title">
                    心级赞助商
                    <span style="padding: 0 3px;">-</span>
                    <a href="https://fly.layui.com/jie/15697/" class="fly-link fly-joinad    ">我要加入</a>
                </div>
                <div class="fly-panel-main">
                    <a href="https://www.larryms.com/cates/5.html" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #64BF98;" time-limit="2018-10-05 0:0:0"> 60秒极速上手，layui案例排名NO1后台框架 </a>
                    <a href="http://www.uileader.com/" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #43BAE9; font-size: 14px;" time-limit="2018-10-20 0:0:0">TouchUI Pro - 一套代码开发App、H5和小程序</a>
                    <a href="https://www.renren.io/layui" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #4BAE4F;" time-limit="2019-09-08 0:0:0"> 人人开源 - 企业级后台脚手架框架 </a>
                </div>
            </div>

        </div>
    </div>
</div>
#end
#define script()
#end
<style>
    .imgicon:hover { color:#c00 }
</style>
<script>
    $('#download').click(function(){
        var tt =new Date().getTime();
        var url = '/upload/downFile';
        var form=$("<form>");//定义一个form表单
        form.attr("style","display:none");
        form.attr("target","");
        form.attr("method","post");//请求类型
        form.attr("action",url);//请求地址
        $("body").append(form);//将表单放置在web中
        var input1=$("<input>");
        input1.attr("type","hidden");
        input1.attr("name","userId");
        input1.attr("value",'#(post.user.id)');
        form.append(input1);
        var input2=$("<input>");
        input2.attr("type","hidden");
        input2.attr("name","userAttachmentId");
        input2.attr("value","#(userAttachment.id)");
        form.append(input2);
        form.submit();//表单提交
    });
</script>
